<?php

namespace App\Http\Controllers\H5;

use App\Models\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Str;

class UserController extends BaseController
{
    public function index()
    {
        //dd((string)Str::uuid());

        $waitPay = $this->user()->boughts()->where('trade_status', 1)->count();
        $waitSend = $this->user()->boughts()->where('trade_status', 2)->count();
        $waitConfirm = $this->user()->boughts()->where('trade_status', 3)->count();
        $waitRate = $this->user()->boughts()->where('trade_status', 4)->where('buyer_rate', 0)->count();
        $refunding = $this->user()->boughts()->where('trade_status', 5)->count();

        return $this->view('h5.user.index', compact('waitPay', 'waitSend', 'waitConfirm', 'waitRate', 'refunding'));
    }

    /**
     * 获取微信推广二维码
     */
    public function getWchatQrcode()
    {
        return $this->view('h5.user.index');
    }

}
